let nums = [1,1,2]
var removeDuplicates = function(nums) {
    let left = 1
    for(let i=1;i<nums.length;i++){
        if(nums[left-1]!==nums[i]){
            nums[left] = nums[i]
            left++
        }
    }
    return left
}
console.log(removeDuplicates(nums));
